function isNumber(val) {
    var s = val.constructor.toString();
    return s.indexOf("Number") > 0;
}
function isString(val) {
    var s = val.constructor.toString();
    return s.indexOf("String") > 0;
}
function isArray(val) {
    var s = val.constructor.toString();
    return s.indexOf("Array") > 0;
}

function int(val) {
    return parseInt(val);
}

function vectorAngle(x1, y1, x2, y2) {
    var cosa = (x1 * x2 + y1 * y2) / (Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2));
    var rad = Math.acos(cosa);
    return rad * 180 / Math.PI;
}

function log(thisObj) {
    if (!RELEASE){
        if (arguments.length == 1) {
            console.log(thisObj);
        } else if (arguments.length > 1) {
            var name;
            if (isString(thisObj) || isNumber(thisObj)) {
                name = thisObj;
            } else {
                name = egret.getQualifiedClassName(thisObj);
            }
            var arr = Array.prototype.slice.call(arguments, 1);
            arr.unshift("[" + name + "]:");
            console.log.apply(console, arr);
        }
    }
}